package com.baizhi.service.impl;

import com.baizhi.entity.Person;
import com.baizhi.mapper.PersonMapper;
import com.baizhi.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class PersonServiceImpl implements PersonService {
    @Autowired
    private PersonMapper personMapper;
    @Override
    public void insertPerson(Person person) {
        personMapper.insertPerson(person);
    }

    @Override
    public void deleteById(Integer id) {
    personMapper.deleteById(id);
    }

    @Override
    public void updatePerson(Person person) {
    personMapper.updatePerson(person);
    }

    @Override
    public Person selectById(Integer id) {
        Person person = personMapper.selectById(id);
        return person;
    }

    @Override
    public Person selectname(String name) {
        Person selectname = personMapper.selectname(name);
        return selectname;
    }

    @Override
    public List<Person> selectPersons() {
        List<Person> people = personMapper.selectPersons();
        return people;
    }

    @Override
    public void deletes(List<Integer> ids) {
        personMapper.deleteSome(ids);
    }
}
